package com.example.mysafegarud;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class SetDialog extends Dialog implements android.view.View.OnClickListener {
    public EditText mFirstPWDET;
    public EditText mAffirmET;
    private MyCallBack myCallBack;//回调接口
    public SetDialog(Context context){
        super(context,R.style.dialog_custom);//引入自定义对话框样式
    }
    public void setCallBack(MyCallBack myCallBack){
        this.myCallBack=myCallBack;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.layout2);
        super.onCreate(savedInstanceState);
        init();
    }

    private void init() {
        mFirstPWDET=findViewById(R.id.et_firstpwd);
        mAffirmET=findViewById(R.id.et_affirm_password);
        findViewById(R.id.qr).setOnClickListener(this);
        findViewById(R.id.qx).setOnClickListener(this);
    }

    @Override
    public void onClick(View v){
        switch (v.getId()){
            case R.id.qr:
                myCallBack.ok();
                break;
            case R.id.qx:
                myCallBack.cancle();
                break;
        }
    }
    public interface MyCallBack{
        void ok();
        void cancle();
    }
}

